{% extends "Cars/sidebar.html" %}
{% block content %}

    <table class="table table-hover table-condensed table-striped">
        <tr>
            <th> Brand </th>
            <th> Model</th>
            <th> Chase No. </th>
            <th> Year </th>
        </tr>
        <tr>
            <td>{{ car.brand }}</td>
            <td>{{ car.car_model }}</td>
            <td>{{ car.chase_no }}</td>
            <td>{{ car.year }}</td>
        </tr>
        <tr>
            <th> Owner </th>
            <th></th><th></th><th></th>

        </tr>
        <tr>
            {% if car.company %}
                <td>{{ car.user }}</td>
            {% else %}
                <td>{{ car.company }}</td>
            {% endif %}

            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <th> Plate Number</th>
            <th> English Part</th>
            <th> Arabic Part</th><th></th>

        </tr>
        <tr>
            <td>{{ car.plate_number }}</td>
            <td>{{ car.plate_str }}</td>
            <td>{{ car.arabic_plate_str }}</td><td></td>

        </tr>
        <tr>
            <th> Registration Expiry </th>
            <th> Checkup Expiry</th><th></th><th></th>
        </tr>
        <tr>
            <td>{{ car.expiry_date }}</td>
            <td>{{ car.checkup_expiry }}</td><td></td><td></td>
        </tr>
        <tr>
            <th> Insurance Company </th>
            <th> Insurance Cost</th>
            <th> Type</th>
            <th></th>

        </tr>
        <tr>
            <td>{{ car.insurance }}</td>
            <td>{{ car.insurance_cost }}</td>
            <td>{{ car.insurance_type }}</td><td></td>

        </tr>

        <tr>

            <th> Start Date </th>
            <th> End Date</th>
            <th></th>
            <th></th>
        </tr>
        <tr>

            <td>{{ car.insurance_start }}</td>
            <td>{{ car.insurance_end }}</td><td></td><td></td>
        </tr>

    </table>


    <div class="span4 offset0">
        <a class="btn" href="../addDoc">Attach Document</a>
        <a class="btn " href="../edit">Edit Car Details</a>
    </div>
    <br />
    <br />
    <br />
    <br />

   <div>


    {%  if docs %}


    <table class="table table-hover table-condensed table-striped">

        <tr>
            <th> Name </th>
            <th> Start Date</th>
            <th> End Date </th>
            <th> download link</th>
        </tr>
        {% for doc in docs %}
        <tr>
            <td><a  href="{{doc.id}}">{{ doc.name}} </a></td>
            <td><a  href="{{doc.id}}">{{ doc.orgDate }} </a></td>
            <td><a  href="{{doc.id}}">{{ doc.expDate}} </a></td>
            <td><a class="btn " href="{{ doc.document.url }}">Download</a></td>
        </tr>
    {%  endfor %}
    </table>
    <div class="span4 offset10"><a class="btn " href="../edit">EDIT</a></div>


   </div>

    {%  endif %}
{% endblock %}